import request from 'utils/request'
export function getArticles ({page, size}) {
  return request({
    url: `/api/v1/article/list/${page}/${size}`,
    method: 'get'
  })
}

export function getArticle ({tid}) {
  return request({
    url: `/api/v1/article/read/${tid}`,
    method: 'get'
  })
}

export function createArticle (data) {
  return request({
    url: `/api/v1/article/create`,
    method: 'post',
    data
  })
}

export function updateArticle (data) {
  return request({
    url: `/api/v1/article/update`,
    method: 'put',
    data
  })
}

export function deleteArticle ({tid}) {
  return request({
    url: `/oapi/article/delete/${tid}`,
    method: 'delete'
  })
}
